package org.nmgyjt.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.nmgyjt.springboot.entity.equipage.Equipage;

import java.util.List;

@Mapper
public interface EquipageMapper extends BaseMapper<Equipage> {
    @Update("<script>\n" +
            "  update equipage set state='1'  \n" +
            "    where id in \n" +
            "    <foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'>\n" +
            "      #{id}\n" +
            "    </foreach>\n" +
            "</script>")
    int deleteByIds(@Param("ids") String[] ids);

    @Update("UPDATE equipage a SET a.state = '1' WHERE a.rescue_team_id = #{id,jdbcType=VARCHAR} ")
    Integer deleteByteamId(@Param("id") String id);
}
